const BaseHandler     = require('../base-handler');
const HTTP_VERBS      = require('../../../constants').HTTP_VERBS;

class WeiboRedirectHandler extends BaseHandler {

    get pattern() {
        return "/weibo/platform/redirect";
    }

    doGET(request, response) {

        this.Controller.getWeiboRedirectURL(request, (url) => {
            return response.redirect(url);
        });
    }

    setup() {
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
    }
}

module.exports = WeiboRedirectHandler;